package cn.edu.sdjzu.controller;

import cn.edu.sdjzu.service.HelloWorldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController{
    @Autowired
    private HelloWorldService helloWorldService; // 注入服务层

    @GetMapping("/hello")
    public String getHelloWorld() {
        // 调用服务层方法
        return helloWorldService.getHelloWorld();
    }
}